home *** CD-ROM | disk | FTP | other *** search
/ Internet 53 / INTERNET53.iso / pc / software / windows / building / coldfusion studio evaluation / data1.cab / CFS_Wizards / CFML / DrillDown_Result.wml < prev    next >
Encoding:
Text File  |  1998-10-08  |  3.1 KB  |  90 lines

  1. <WIZSET QueryFieldList = ''>
  2. <WIZSET FieldCount = '0'>
  3. <WIZLOOP index="CurrentField" list="$${ResultFields}">
  4.     <WIZSET FieldCount = FieldCount + 1>
  5.     <!---- field is in format 'sTable.sField=sType;nSize;bRequired' ---->
  6.     <WIZSET SeparatorPos = Find( CurrentField, '=' )>
  7.     <WIZSET TableFieldName = Left( CurrentField, SeparatorPos - 1 )>
  8.     <WIZSET QueryFieldList = QueryFieldList & TableFieldName & ' AS ResultField' & FieldCount & ', '>
  9. </WIZLOOP>
  10. <WIZSET SeparatorPos = Find( UniqueIdentifier, '=' )>
  11. <WIZSET TableFieldName = Left( UniqueIdentifier, SeparatorPos - 1 )>
  12. <WIZSET QueryFieldList = QueryFieldList & TableFieldName & ' AS ID_Field'>
  13.  
  14.  
  15. <WIZSET QueryTableList = ''>
  16. <WIZLOOP index="i" list="$${Tables}">
  17.   <WIZSET QueryTableList = QueryTableList & i & ', '>
  18. </WIZLOOP>
  19. <WIZSET QueryTableList = Left( QueryTableList, Len(QueryTableList) - 2 )>
  20.  
  21.  
  22. <WIZSET QueryJoinList = ''>
  23. <WIZLOOP index="i" list="$${Joins}">
  24.   <WIZSET QueryJoinList = QueryJoinList & i & ' AND '>
  25. </WIZLOOP>
  26.  
  27. <!--- Create Criteria string for query from data entered thru search form --->
  28. <CFSET Criteria = ''>
  29. <WIZSET i = 0
  30. ><WIZLOOP index="CurrentField" list="$${SearchFields}"
  31. ><WIZSET i = i + 1><CF_$${SafeApplicationName}_AppendCriteria
  32.     FieldName="#Form.Crit$${i}_FieldName#"
  33.     FieldType="#Form.Crit$${i}_FieldType#"
  34.     Operator="#Form.Crit$${i}_Operator#"
  35.     Value="#Form.Crit$${i}_Value#">
  36. </WIZLOOP>
  37.  
  38. <!----
  39. <CFSET GetOperator = "ListGetAt( ##OperatorList##, ##FormCondition## )">
  40. <CFSET GetOperand = "Evaluate( ListGetAt( ##OperandList##, ##FormCondition## ))">
  41.  
  42. <CFSET ConditionList = "CONTAINS,EQUAL,NOT_EQUAL,BEGINS_WITH,ENDS_WITH,GREATER_THAN,SMALLER_THAN,GREATER_EQUAL,SMALLER_EQUAL">
  43. <CFSET OperatorList = "LIKE,=,<>,LIKE,LIKE,>,<,>=,<=">
  44. <CFSET OperandList = """%##FormValue##%"",""##FormValue##"",""##FormValue##"",""##FormValue##%"",""%##FormValue##"",""##FormValue##"",""##FormValue##"",""##FormValue##"",""##FormValue##""">
  45. ---->
  46.  
  47. <!--- Query returning search results --->
  48. <CFQUERY name="SearchResult" dataSource="$${DataSource}">
  49.     SELECT DISTINCT $$QueryFieldList
  50.     FROM $$QueryTableList
  51.     WHERE $$QueryJoinList
  52.         #PreserveSingleQuotes(Criteria)#
  53. </CFQUERY>
  54.  
  55.  
  56. <HTML><HEAD>
  57.     <TITLE>$${ApplicationName} - Search Result</TITLE>
  58. </HEAD><BODY bgcolor="ffffff">
  59.  
  60.  
  61. <FONT size="+1">$$ApplicationName</FONT> <BR>
  62. <FONT size="+2"><B>Search Result</B></FONT>
  63.  
  64. <P>
  65.  
  66. <TABLE border=0 cellpadding=3 cellspacing=0>
  67.  
  68. <TR bgcolor="cccccc">
  69.     <TD> </TD>
  70. <WIZLOOP index="i" list="$${ResultFields}"
  71. ><WIZSET Separator1Pos = Find( i, '.' )
  72. ><WIZSET Separator2Pos = Find( i, '=' )
  73. ><WIZSET FieldName = Mid( i, Separator1Pos + 1, Separator2Pos - Separator1Pos - 1 )
  74. >    <TD>$${FieldName}</TD>
  75. </WIZLOOP>
  76. </TR>
  77.  
  78. <CFOUTPUT query="SearchResult">
  79. <TR bgcolor="#IIf(CurrentRow Mod 2, DE('ffffff'), DE('ffffcf'))#">
  80.     <TD><A href="$${SafeApplicationName}_Detail.cfm?ID=#URLEncodedFormat(ID_Field)#">[detail]</A></TD>
  81.     <WIZLOOP index="i" from="1" to="$${FieldCount}" step="1"
  82.     ><TD>#ResultField$${i}#</TD>
  83. </WIZLOOP>
  84. </TR>
  85. </CFOUTPUT>
  86.  
  87. </TABLE>
  88.  
  89.  
  90. </BODY></HTML>